/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package somsinfinal;

import java.awt.Dimension;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JFrame;

/**
 *
 * @author Somsin Corp.
 */
class PaintTask extends TimerTask {

    Board mmp = null;

    public PaintTask(Board mmp) {
        this.mmp = mmp;
    }

    @Override
    public void run() {
        mmp.repaint();
    }
}

public class SomsinFinal {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        JFrame f = new JFrame("Somsin Tank Game");

        Board board = new Board();
       
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new PaintTask(board), 0, 20);

        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(new Dimension(820, 605));         
    

        f.addKeyListener(board);
        f.addMouseMotionListener(board);
        f.addMouseListener(board);
        f.setContentPane(board);
        f.setVisible(true);
    }
}
